<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/SellGoods',
    'namespace'     => 'Beerus\\Modules\\SellGoods\\Controllers',
    'middleware'    => ['web', 'admin'],
], function (Router $router) {
    $router->get('/InviteRecord','InviteRecordController@index');  //邀请记录列表

	// 前台类目排序
	$router->post('/sort', 'ClassifyMapController@sort');
	$router->post('/classifyMap/{classifyId}/sort', 'ClassifyMapController@sort');
	$router->post('/classifyMap/{classifyId}/edit/{secondCategoryId}/sort', 'ClassifyMapController@sort');
	// 前台一级类目列表
	$router->get('/classifyMap', 'ClassifyMapController@list');
	// 创建前台一级类目
	$router->get('/classifyMap/create', 'ClassifyMapController@classifyEdit');
	// 编辑前台一级类目
	$router->get('/classifyMap/{firClassifyId}/edit', 'ClassifyMapController@classifyEdit');
	// 删除前台一级类目
	$router->delete('/classifyMap/{classifyId}', 'ClassifyMapController@delClassify');
	// 修改前台一级类目
	$router->put('/classifyMap/{classifyId}', 'ClassifyMapController@editClassify');
	// 保存前台一级类目
	$router->post('/classifyMap/{firClassifyId}/save', 'ClassifyMapController@saveClassify');
	// 创建前台二、三级类目
	$router->get('/classifyMap/{firClassifyId}/edit/create', [
		'uses' => 'ClassifyMapController@childClassifyEdit',
		'as' => '2'
	]);
	$router->get('/classifyMap/{firClassifyId}/edit/{secClassifyId}/edit/create', [
		'uses' => 'ClassifyMapController@childClassifyEdit',
		'as' => '3'
	]);
	// 编辑前台二、三级类目
	$router->get('/classifyMap/{firClassifyId}/edit/{secClassifyId}/edit', 'ClassifyMapController@childClassifyEdit');
	$router->get('/classifyMap/{firClassifyId}/edit/{secClassifyId}/edit/{thirdClassifyId}/edit', 'ClassifyMapController@childClassifyEdit');
	$router->put('/classifyMap/{firClassifyId}/edit/{secClassifyId}', 'ClassifyMapController@editClassify');
	$router->put('/classifyMap/{firClassifyId}/edit/{secClassifyId}/edit/{thirdClassifyId}', 'ClassifyMapController@editClassify');
	// 删除前台二、三级类目
	$router->delete('/classifyMap/{firClassifyId}/edit/{secClassifyId}', 'ClassifyMapController@delClassify');
	$router->delete('/classifyMap/{firClassifyId}/edit/{secClassifyId}/edit/{thirdClassifyId}', 'ClassifyMapController@delClassify');
	// 保存前台二、三级类目
	$router->post('/classifyMap/{firClassifyId}/edit/{secClassifyId}/save', 'ClassifyMapController@saveChildClassify');
	$router->post('/classifyMap/{firClassifyId}/edit/{secClassifyId}/edit/{thirdClassifyId}/save', 'ClassifyMapController@saveChildClassify');
});
